<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateRechargeTaskTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('recharge_task', function (Blueprint $table) {
            $table->increments('id');
            $table->string("task_sn",30)->default('')->comment("任务号");
            $table->tinyInteger("type")->default(0)->comment("类型 1 油卡充值 2 话费充值");
            $table->integer("order_id")->default(0)->comment("订单ID");
            $table->integer("order_detail_id")->default(0)->comment("订单详情ID");
            $table->integer("uid")->default(0)->comment("用户ID");
            $table->integer("recharge_amount")->default(0)->comment("充值金额（分）");
            $table->smallInteger("proid")->default(0)->comment("聚合产品ID");
            $table->string("mobile",15)->default('')->comment("手机号");
            $table->string("oilcard_no",30)->default('')->comment("油卡卡号");
            $table->string("oilcard_name",10)->default('')->comment("持卡人姓名");
            $table->tinyInteger("oilcard_type")->default(0)->comment("油卡类型 1中石化，2中石油");
            $table->tinyInteger("recharge_mode")->default(0)->comment("充值方式1自动2手动");
            $table->tinyInteger("result_status")->default(0)->comment("状态 1 待充值 2请求成功 3请求失败 4 充值成功 5 充值失败 6 取消");
            $table->string("result",500)->default('')->comment("充值结果");
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('recharge_task');
    }
}
